from django.conf.urls import url
from . views import IndexViews,UsersViews,TypesViews,GoodsViews,OrderViews

urlpatterns = [
    # 后台管理
    url(r'^$',IndexViews.index,name='myadmin_index'),
    # 后台登录页面
    url(r'^login/$',  IndexViews.login,name="myadmin_login"),
    url(r'^logout/$',  IndexViews.logout,name="myadmin_logout"),

    # 会员管理
    url(r'^user/add/$',UsersViews.useradd,name='myadmin_user_add'),
    url(r'^user/insert/$',UsersViews.userinsert,name='myadmin_user_insert'),
    url(r'^user/index/$',UsersViews.userindex,name='myadmin_user_index'),
    url(r'^user/index/(?P<iidd>[0-9]+)/$', UsersViews.userdel, name='myadmin_user_del'),
    url(r'^user/edit/(?P<edit_id>[0-9]+)/$', UsersViews.edit, name='myadmin_user_edit'),
    url(r'^user/update/$',  UsersViews.userupdate,name="myadmin_user_update"),


    # 分类管理

    # 添加
    url(r'^types/add/$',TypesViews.typesadd,name = 'myadmin_types_add'),
    # 列表
    url(r'^types/index/$', TypesViews.typesindex, name='myadmin_types_index'),
    # 更新
    url(r'^types/update/$', TypesViews.typesupdate, name='myadmin_types_update'),
    # 删除
    url(r'^types/delete/$', TypesViews.typesdelete, name='myadmin_types_delete'),
    # 插入(添加的数据插入到数据库)
    url(r'^types/insert/$', TypesViews.typesinsert, name='myadmin_types_insert'),


    # 商品管理
    # 列表
    url(r'^goods/index/$', GoodsViews.goodsindex, name='myadmin_goods_index'),
    # 执行添加
    url(r'^goods/insert/$', GoodsViews.goodsinsert, name='myadmin_goods_insert'),
    # 添加
    url(r'^goods/add/$', GoodsViews.goodsadd, name='myadmin_goods_add'),

    # 编辑
    url(r'^goods/edit/(?P<goods_edit_id>[0-9]+)/$', GoodsViews.goodsedit, name='myadmin_goods_edit'),

    # 删除
    url(r'^goods/del/$', GoodsViews.goodsdel, name="myadmin_goods_del"),
    # 执行删除
    url(r'^goods/update/$', GoodsViews.goodsupdate, name="myadmin_goods_update"),

    # 订单列表
    url(r'^order/list/$', OrderViews.orderlist, name="myadmin_order_list"),

]



